﻿   <script type="text/javascript" src="/js/jquery.pagination.js"></script>
   <script type="text/javascript">
		$(document).ready(function(){
		var pageIndex = 0;
        var bb='';
        var dd='';
        
		var pageSize = <?php echo $pageSize;?>;
		$("#Pagination").pagination(<?php echo $pagecount;?>, { 
		callback: PageCallback, //PageCallback() 为翻页调用次函数。 
		prev_text: "&laquo; 上一页", 
		next_text: "下一页 &raquo;", 
		items_per_page:pageSize, 
		num_edge_entries: 2, //两侧首尾分页条目数 
		num_display_entries: 6, //连续分页主体部分分页条目数 
		current_page: pageIndex //当前页索引 
		});
		function PageCallback(index, jq) { 
			//index == 0 ? index = 1 : index = index;
			InitTable(index); 
			
		} 
		$("#button").click(function() 
		{
			bb = encodeURI($("#nbg").val());
			if(bb == '')
			{
				alert('请输入要查询的条件');
				//return false;
			}else{
				
				InitTable(0); 
			}
		});
        
       $("#fensi").click(function(){
            postd(1);
        
       });
       $("#regtime").click(function(){
            postd(2);
        
       });
       $("#zhuangtai").click(function(){
            postd(3);
        
       });
       function postd(ggg){
            dd = ggg;
            InitTable(0);
        }
		function InitTable(pageIndex) { 
		  
          $.ajax({ 
		      type: "get", 
              data: "nbg="+bb+"&order="+dd,
		      dataType: "text", 
		      url: '<?PHP echo site_url("tlianmengs/address");?>/'+(pageIndex), //提交到一般处理程序请求数据 
             success: function(data) { 
		      $("#Result tr:gt(0)").remove(); //移除Id为Result的表格里的行，从第二行开始（这里根据页面布局不同页变） 
		      $("#Result").append(data); //将返回的数据追加到表格 
		      } 
		  }); 
		} 
     
		});
	
   </script>
    <!-- Page title -->
    <div id="pagetitle">
		我的桌面 客户管理
        <div id="titleedit"></div>
</div>
    <!-- End of Page title -->
    <!-- Page content -->
    <div id="page">
	 
	  <p></p>
      <table width="100%" border="1" cellpadding="4" cellspacing="0" bordercolor="#CCCCCC" id="Result">
          <tr align="center">
          <td width="11%">微博ID</td>
			
            <td width="11%">昵称</td>
            <td width="11%">订单号</td>
            <td width="11%">联系人</td>
            <td width="11%">手机号码</td>
            <td width="12%">送货地址</td>
	   <td width="11%">邮编</td>
	 <td width="11%">提交时间</td>
            <td width="11%">操作</td>
          </tr>
          <tr align="center">
            <td colspan="6"><img src="/img/loading.gif" width="43" height="43" />加载中.....</td>
          </tr>
      </table>
      <div id="Pagination"></div>
            <div class="modal" id="setuser">
      <h2>修改发货状态</h2>
      <form action="<?=site_url('/tlianmengs/setaddressstatus')?>" method="post">
<input type="hidden" id="order_id" name="order_id" />
<input type="hidden" id="address_id" name="address_id" />
      	微博ID：<input type="text" id="weiboid" class="full"  value="" name="weiboid" readonly="readonly" /><br />
        昵称：<input type="text" id="nbc" class="full"  value="" name="nbc" readonly="readonly" /><br />
        当前状态：<select name="u_status" id="u_status">
                <option value="0">请选择</option>
                <option value="1">已发货</option>
                </select><br />
        <input type="submit" class="btn btn-green big" value="修改"/> &nbsp;&nbsp; 
        <span class="close"><input type="button" id="overlayClose" class="btn btn-green big" value="返回" /></span>
        <input type="hidden" name="verification" id="verification" value="<?=$verification?>" />
        
      </form>
      </div>
     
      <div class="modal" id="jilus">
      <a id="zhichu">支出</a>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" id="sssss">
          <tr>
            <td>类型</td>            <td>积分</td>
            <td>时间</td>
          </tr>
          <tr>
            <td colspan="3" align="center"><img src="/img/loading.gif" width="43" height="43" />加载中.....</td>
          </tr>
          
         
        </table>
     
      </div>
      <script>
	  var mm = '';
	  var ptye = '';
	  var pageIndex = 1;
	  $('#getupp').click(function() {
       	 pageIndex--;
		 InitTable(pageIndex); 
    });
	 $('#getdownp').click(function() {
       	 pageIndex++;
		 InitTable(pageIndex); 
    });
	  function cc(uid,ptype){
		if(uid != ''){
			mm = uid;
		}
		ptye =  ptype;
		$("#jilus").overlay().load();
		
        var pageSize = 20;
		$("#Pagination").pagination(5000, { 
		callback: PageCallback, //PageCallback() 为翻页调用次函数。 
		prev_text: "&laquo; 上一页", 
		next_text: "下一页 &raquo;", 
		items_per_page:pageSize, 
		num_edge_entries: 2, //两侧首尾分页条目数 
		num_display_entries: 6, //连续分页主体部分分页条目数 
		current_page: pageIndex //当前页索引 
		});
		function PageCallback(index, jq) { 
			//index == 0 ? index = 1 : index = index;
			InitTable(index); 
			
		}
		function InitTable(pageIndex) { 
		  
          $.ajax({ 
		      type: "get", 
              data: "uid="+mm+'&ptype='+ptye,
		      dataType: "text", 
		      url: '<?PHP echo site_url("tlianmengs/get_uidc");?>/'+(pageIndex), //提交到一般处理程序请求数据 
             success: function(data) { 
		      $("#sssss tr:gt(0)").remove(); //移除Id为Result的表格里的行，从第二行开始（这里根据页面布局不同页变） 
		      $("#sssss").append(data); //将返回的数据追加到表格 
		      } 
		  }); 
		}  
		  
	 }
	 $("#shourus").click(function(){
		 	cc('',1);
		 });
	$("#zhichu").click(function(){
		 	cc('',2);
		 });
	  function aa(nid,wbid,nic,status,address_id,order_id) {
		    
			$(nid).overlay().load();
		  	if(nid == '#setuser')
			{
				$('#weiboid').val(wbid);
                                $('#nbc').val(nic);
				 $('#order_id').val(order_id);
			   $('#address_id').val(address_id);
                                var i,pr = document.getElementById('u_status');
	
                                for(i=0;i<pr.length;i++)
                                {
		
                                    if(pr.options[i].value == status)
                                    {
                                        pr.options[i].selected =true;	
                                    }	
                                }
			}else{
                           $('#weiboid1').val(wbid);
                                $('#nbc1').val(nic); 
                        }
		  }
	 	$("#setuser").overlay({
			  mask: {
				  color: '#ebecff', 
				  loadSpeed: 200, 
				  opacity: 0.9,
				  close:'#overlayClose'
				  },       
			closeOnClick: false,
			  });
		$("#chongzhi").overlay({
			  mask: {
				  color: '#ebecff', 
				  loadSpeed: 200, 
				  opacity: 0.9,
				  close:'#overlayClose'
				  },       
			closeOnClick: false,
			  });
			  $("#jilus").overlay({
			  mask: {
				 
				  cmask: 'darkred',
				  effect: 'apple',
				  olor: '#ebecff', 
				  loadSpeed: 200, 
				  opacity: 0.9,
				  close:'#overlayClose'
				  },       
			closeOnClick: true,
			  });
			  
                          function a(b,c){if(b==c){return"selected='selected'"}else{return""}}
	  </script>
    </div>
    